#ifndef FileTrans_H
#define FileTrans_H

#include <fcntl.h>
#include <vector>
#include <queue>
#include "../QCommon/events.h"

using namespace std;

class FileIn
{
private:
    const char* get_store_location() const;

    friend void* recv_file(void*);
public:
    void start_recv();
    static FileIn& getInstance();
protected:
    FileIn(){}
};


class FileOut
{
private:
    vector<FileAskEvent> wait;
    queue<FileAnswerEvent> sending;

    friend void* send_file(void*);
    friend void* recv(void*);
    friend void* send(void*);
public:
    void start_send();
    void send(FileAskEvent);
    void ack(FileAnswerEvent&);
    static FileOut& getInstance();
protected:
    FileOut(){}
};


#endif
